//
//  NetWorkTool.swift
//  WSWB
//
//  Created by 刘 伟生 on 16/1/12.
//  Copyright © 2016年 seasa. All rights reserved.
//

import UIKit
import AFNetworking

class NetWorkTool: AFHTTPSessionManager {
    
//    创建一个会话管理者(单例)
    static let shareInstance : NetWorkTool = {
        // 注意: 指定baseURL一定要以/结尾
        let baseURL = NSURL(string: "https://api.weibo.com/")
        
        //创建一个NetWorkTool对象
        let tool = NetWorkTool(baseURL: baseURL)
        //设置响应格式
        tool.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as? Set<String>
        return tool
       
    }()

}
